
export default {
    state: {
        sign:{
            outtime:'已逾期',
            warning:'报警中',
            success:'已续费'
        },
        temp: {
            ip: "",
            end_time: "",
            add_time: "",
            id:''
        },
        list: [{}],
        listQuery: {
            page: 1,
            limit: 20,
            end_time: '',
            ip: undefined,
            status: undefined,
            sort: "+id",
            begin_time:''
        },
        total: 0,
        delete_ip:'',
        renew_ip:'',
        renew_id:'',
        num_ip:0
    },
    mutations: {
        cleartemp_ip(state, payload) {
            // console.log(payload);
            payload=payload || {};
            // state.list[state.num_ip]=payload
            state.list[state.num_ip].add_time=payload.add_time
            state.list[state.num_ip].end_time=payload.end_time
            state.list[state.num_ip].pay_warning_time=payload.pay_warning_time
            state.list[state.num_ip].status=payload.status
            state.list[state.num_ip].valid_time=payload.valid_time
            // console.log(state.list[state.num_ip]);
            // console.log(state.temp.end_time);
            state.temp = { ip: '', end_time: '', add_time: '' }
        },
        list_ip(state, payload) {
            state.list = payload.list
            state.total = payload.total
        },
        changelimit_ip(state, payload) {
            state.listQuery.limit = payload
        },
        changepage_ip(state, payload) {
            state.listQuery.page = payload
        },
        clearListQuery_ip(state, payload) {
            state.listQuery.page = 1
        },
        getIpSign_ip(state,payload){
            state.temp={...payload}
            // console.log(state.temp);
        },
        deleteStatus_ip(state,payload){
            state.delete_ip=payload
        },
        renewStatus_ip(state,payload){
            state.renew_ip=payload.status
            state.renew_id=payload.row
        },
        changeList_ip(state,payload){
            // console.log('续费前',state.list[state.renew_id].end_time);
            state.list[state.renew_id].add_time=payload.add_time
            state.list[state.renew_id].end_time=payload.end_time
            state.list[state.renew_id].pay_warning_time=payload.pay_warning_time
            state.list[state.renew_id].status_name=payload.status
            state.list[state.renew_id].valid_time=payload.valid_time
            // console.log('续费后',state.list[state.renew_id].end_time);
        },
        serchTime_ip(state,payload){
            state.listQuery.begin_time=payload[0].trim()
            state.listQuery.end_time=payload[1].trim()
        },
        getTempId_ip(state,payload){
            state.temp.id=payload.index
            state.num_ip=payload.row
            // console.log(state.temp.id);
            // console.log(state.num_ip);
            // console.log(state.temp);
        }
    },
    actions: {

    }
}